package com.el.loggers;

import org.apache.log4j.Logger;

import com.el.logger.ELogger;
import com.el.logger.EventLogEntry;
import com.el.logger.StandardLogFormatter;

public class ConsoleELogger extends ELogger {

    private static final Logger LOGGER = Logger.getLogger(ConsoleELogger.class); 
    
    private StandardLogFormatter formatter = new StandardLogFormatter();
    
    @Override
    public void log(EventLogEntry logEntry) {
        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace(formatter.format(logEntry));
        }
    }

    @Override
    public void init() {
        // empty
    }

    @Override
    public void close() {
        // empty
    }

    public void setFormatter(StandardLogFormatter formatter) {
        this.formatter = formatter;
    }
    
    

}
